//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<render_scheduler.cpp>
///	@path	~/src/engine/xcore/
///	@date	2008/03/23
///	@desc	.

#include "config/config.h"

#include "lib/utilities/debug.h"
#include "lib/system/thread_debug.h"

#include "engine/xcore/render_scheduler.h"

namespace xeres {

	// RenderScheduler
	RenderScheduler::RenderScheduler( void )
	{

	}
	// ~RenderScheduler
	RenderScheduler::~RenderScheduler( void )
	{

	}
	// RenderFrame
	void RenderScheduler::RenderFrame( void )
	{
		TRACK_FUNCTION_SCOPE();
		RUNNING_ON_THREAD( _S("render") );

		// render
		if( GetDevice()->BeginRender() )
		{
			// dispatch to render manager
			RenderManager::Render();

			// final
			GetDevice()->EndRender();
		}
	}
	// IsEnableRender
	bool RenderScheduler::IsEnableRender( void )
	{
		return GetDevice().IsValid() && GetDevice()->IsEnableRender();
	}

} // namespace xeres
